Skip to content

fix(ui): bulk upload issues #13413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 12, 2025

Conversation

lukebennett
Copy link
Contributor

What?

This PR contains a couple of fixes to the bulk upload process:

  • Credentials not being passed when fetching, leading to auth issues
  • Provide a fallback to crypto.randomUUID which is only available when using HTTPS or localhost

Why?

I use separate admin and API URLs and work off a remote dev server using custom hostnames. These issues may not impact the happy path of using localhost, but are dealbreakers in this environment.

Fixes

These are issues I found myself, I fixed them rather than raising issues for somebody else to pick up, but I can create issues to link to if required.

Copy link
Contributor

@JarrodMFlesch JarrodMFlesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what we do everywhere else, but this actually will evaluate to undefined/api/route if you don't define a serverURL. Can you see what we do elsewhere?

@lukebennett
Copy link
Contributor Author

I'm not sure what we do everywhere else, but this actually will evaluate to undefined/api/route if you don't define a serverURL. Can you see what we do elsewhere?

It's already depended on elsewhere in the same file e.g.

const res = await fetch(`${serverURL}${api}${docAccessURL}?${qs.stringify(params)}`, {
and
`${serverURL}${api}${docAccessURL}?${qs.stringify(params)}`,
so there's no new dependency introduced here.

Besides, it should never be undefined as it's given a default value of a blank string here:

config.serverURL = config.serverURL ?? ''

@lukebennett
Copy link
Contributor Author

The test failure is down to Docker Hub rate limiting, don't think there's anything I can really do about it

@lukebennett
Copy link
Contributor Author

lukebennett commented Aug 10, 2025

I've found another of these invalid fetch calls (that don't work with a custom API URL) in plugin-search. It's nothing to do with the bulk upoad but the same fix. Would you like me to add another commit here or open a new PR for it?

@JarrodMFlesch JarrodMFlesch merged commit a374aab into payloadcms:main Aug 12, 2025
169 of 171 checks passed
@JarrodMFlesch
Copy link
Contributor

I've found another of these invalid fetch calls (that don't work with a custom API URL) in plugin-search. It's nothing to do with the bulk upoad but the same fix. Would you like me to add another commit here or open a new PR for it?

Another PR would be great.

Copy link
Contributor

🚀 This is included in version v3.51.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants